// Copyright (c) 2007 Robin Boerdijk. All rights reserved.
//
// This software is licensed under the terms of the Microsoft Reciprocal License as described 
// in the file LICENSE.txt, which you should have received as part of this distribution. The 
// license terms are also available at http://www.opensource.org/licenses/ms-rl.html.

#ifndef wtk_ContainerBox_h_included
#define wtk_ContainerBox_h_included

#include "wtk/ContentBox.h"

#include <vector>

namespace wtk
{
	class Control;
	class ControlBox;
	class GridBox;
	class FillerBox;

	class ContainerBox : public ContentBox
	{
	public:

		typedef std::vector<Box *>::size_type Count;

		ContainerBox(Count initialCapacity);

		virtual ~ContainerBox();

		ControlBox *AddControlBox(Control &control, long horizontalElasticity = 0, long verticalElasticity = 0);

		GridBox *AddGridBox(Count columnCount, Count expectedRowCount, int flags = 0);

		FillerBox *AddFillerBox(const SIZE &minimumSize = Zero<SIZE>(), long horizontalElasticity = 1, long verticalElasticity = 1);

	protected:

		std::vector<Box *> m_boxes;

		template<typename BoxT> BoxT *Add(BoxT *box) { m_boxes.push_back(box); return box; }
	};
}

#endif